package com.muyu.payment.domain;

import com.baomidou.mybatisplus.annotation.*;
import com.muyu.common.core.web.domain.BaseEntity;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;
import lombok.AllArgsConstructor;
import lombok.experimental.SuperBuilder;

import java.math.BigDecimal;
import java.util.Date;

/**
 * 用户余额实体类
 *
 * @author muyu
 * @date 2025-01-27
 */
@Data
@SuperBuilder
@NoArgsConstructor
@AllArgsConstructor
@EqualsAndHashCode(callSuper = true)
@TableName("user_balance")
@Schema(description = "用户余额")
public class UserBalance extends BaseEntity {
    private static final long serialVersionUID = 1L;

    /**
     * 主键ID
     */
    @TableId(value = "id", type = IdType.AUTO)
    @Schema(description = "主键ID")
    private Long id;

    /**
     * 用户ID
     */
    @Schema(description = "用户ID")
    private Long userId;

    /**
     * 用户账号
     */
    @Schema(description = "用户账号")
    private String userName;

    /**
     * 余额
     */
    @TableField("balance")
    @Schema(description = "余额")
    private BigDecimal balance;

    /**
     * 版本号（乐观锁）
     */
    @Version
    @Schema(description = "版本号")
    private Integer version;

    /**
     * 状态（0:正常 1:冻结）
     */
    @Schema(description = "状态（0:正常 1:冻结）")
    private Integer status;

    /**
     * 备注
     */
    @Schema(description = "备注")
    private String remark;
}